package thread;

public class ThreadDemo8 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
            // 这个线程的运行时间大概是1秒
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });
        System.out.println("start 之前线程是否存活" + t.isAlive());
        t.start();
        System.out.println("start之后 线程是否存活" + t.isAlive());
        Thread.sleep(2000);
        System.out.println("结束之后 线程是否存活" + t.isAlive());
    }
}

